import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import qiankun from "vite-plugin-qiankun"
const packageName = require('./package.json').name
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: 3001,
    cors: true,
    origin: 'http://127.0.0.1:3001'
  },
  plugins: [
    vue(),
    qiankun("vitesub2", {
      useDevMode: true,
    }),
  ],
  output: {
    library: `${packageName}-[name]`,
    libraryTarget: 'umd',
    chunkLoadingGlobal: `webpackJsonp_${packageName}`,
  },
})
